package com.niiwoo.civet.account.dao.mapper;


import com.niiwoo.civet.account.dao.entity.PayChannel;
import com.niiwoo.civet.account.enums.OrderEnum;
import com.niiwoo.civet.account.enums.PayChannelTypeEnum;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PayChannelMapperExt extends PayChannelMapper{

    /**
     * 通过支付渠道名字查询
     * @param channelCode
     * @return
     */
    PayChannel queryPayChannelByCode(String channelCode);

    /**
     * 查询用户充值路由通道
     * @param userId
     * @return
     */
    PayChannel selectUserRechargeChannelByRoute(@Param("userId") String userId, @Param("bankTypeId") Long bankTypeId);

    /**
     * 根据类型查询某个银行当前的路由通道
     * @param bankTypeId
     * @param payChannelType
     * @return
     */
    PayChannel selectBankChannelByRoute(@Param("bankTypeId") Long bankTypeId, @Param("payChannelType") PayChannelTypeEnum payChannelType);

    PayChannel selectWithHoldChannelByBank(Long bankTypeId);

    /**
     * 查询某个银行是否支持代扣
     * @param bankTypeId
     * @return
     */
    PayChannel selectIfSupportWithhold(@Param("bankTypeId")Long bankTypeId);

    PayChannel selectPayChannelCode();

    /**
     * 查询银行支付通道
     */
    List<PayChannel> selectPayChannelByType(@Param("channelType")String channelType,@Param("status")byte status, @Param("orderEnum") String orderEnum);

}